package com.leyou.search.service;

import com.leyou.common.vo.PageResult;
import com.leyou.search.pojo.Goods;
import com.leyou.search.utils.SearchRequest;

import java.util.List;
import java.util.Map;

/**
 * Created by IntelliJ IDEA.
 *
 * @author: wangzibeng
 * Date: 2019/5/6 0006
 * Time: 22:37
 */

public interface SearchService {
    /**
     * f分页查询goods 条件搜索
     *
     * @param searchRequest
     * @return
     */
    PageResult<Goods> queryGoodsByPage(SearchRequest searchRequest);

    /**
     * 分页查询查询goods并且按价格排序查询
     *
     * @param searchRequest
     * @return
     */
    PageResult<Goods> queryGoodsByPageAndPrice(SearchRequest searchRequest);

    /**
     * 分页查询goods并且按销量排序
     * 未实现
     *
     * @param searchRequest
     * @return
     */
    PageResult<Goods> queryGoodsByPageAndStock(SearchRequest searchRequest);

    /**
     * 分页查询goods并且按创建时间排序
     *
     * @param searchRequest
     * @return
     */
    PageResult<Goods> queryGoodsByPageAndUpdate(SearchRequest searchRequest);


    /**
     * 查询过滤
     *
     * @param searchRequest
     * @return
     */
    Map<String, List<?>> queryFilter(SearchRequest searchRequest);

    /**
     * 根据spuId新增索引
     *
     * @param spuId spuID
     */
    void createIndex(Long spuId);

    /**
     * 根据spuId 删除索引
     *
     * @param spuId SpuId
     */
    void deleteIndex(Long spuId);
}
